package com.baizhi.cmfz.controller;

import com.baizhi.cmfz.annottation.AddCacheAnnotation;
import com.baizhi.cmfz.annottation.LogAnnottion;
import com.baizhi.cmfz.entity.Menu;
import com.baizhi.cmfz.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.constraints.Null;
import java.util.List;

@Controller
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;
    @ResponseBody
    @RequestMapping("/selectAllMenu")
    @LogAnnottion(type = "select", value = "查询所有菜单")
    @AddCacheAnnotation
    public List<Menu>selectAllMenu(){
        return  menuService.selectAll();
    }
}
